package com.yaojiaxun.logisticsPlatformSystem.util;

import com.yaojiaxun.logisticsPlatformSystem.vo.ResultVO;

/**
 * @Auther: yjx_j
 * @Date: 2018/10/22 18:54
 * @Description:
 */
public class ResultVOUtil {
    /**
     * 封装成功返回数据
     */
    public static ResultVO success(Object object){
        ResultVO resultVO = new ResultVO();
        resultVO.setData(object);
        resultVO.setMsg("成功");
        resultVO.setCode(0);
        return resultVO;
    }
    public static ResultVO success(){
        return success(null);
    }

    /**
     * 封装失败返回数据
     */
    public static ResultVO error(Integer code, String msg){
        ResultVO resultVO = new ResultVO();
        resultVO.setMsg(msg);
        resultVO.setCode(code);
        return resultVO;
    }
}
